using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.Busi.Entity
{
	[Table("MeetingRoomGoods", "ID", "Busi.ConnectionString")]
	public class MeetingRoomGoods : Info
	{
		#region SQL column name consts 
		public const string SQLCOL_ID = "ID";
		public const string SQLCOL_GOODSNAME = "GoodsName";
		public const string SQLCOL_GOODSDESCRIPT = "GoodsDescript";
		#endregion


		#region Contructors
		/// <summary>
		/// Construct empty entity
		/// </summary>
		public MeetingRoomGoods () {}

		/// <summary>
		/// Construct entity by primary key, other fields will be assigned by 
		/// "Load" method.
		/// </summary>
		public MeetingRoomGoods (int ID)
		{
			this.ID = ID;
		}
		#endregion

		public override void Init (DataRow row)
		{
			ID = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_ID]);
			GoodsName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_GOODSNAME]);
			GoodsDescript = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_GOODSDESCRIPT]);
		}

		#region Properties 
		#region Property <int> ID
		[Property("ID", 4, SqlDbType.Int, true, true)]
		public int ID 
		{
			get { return _ID; }
			set { _ID = value; }
		}
		private int _ID = int.MinValue;
		#endregion

		#region Property <string> GoodsName
		[Property("GoodsName", 200, SqlDbType.NVarChar, false, false)]
		public string GoodsName 
		{
			get { return _GoodsName; }
			set { _GoodsName = value; }
		}
		private string _GoodsName = null;
		#endregion

		#region Property <string> GoodsDescript
		[Property("GoodsDescript", 1000, SqlDbType.NVarChar, false, false)]
		public string GoodsDescript 
		{
			get { return _GoodsDescript; }
			set { _GoodsDescript = value; }
		}
		private string _GoodsDescript = null;
		#endregion
		#endregion


		public bool LoadByIdentity(int ID)
		{
			return DataAccess.SelectByIdentity(this, Convert.ToInt64(ID));
		}


		public bool DeleteByIdentity()
		{
			return DataAccess.DeleteByIdentity(this);
		}
	}
}
